package com.example.zzl.view.fragment.ShareOrderFragment.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.zzl.R;
import com.example.zzl.view.fragment.ShareOrderFragment.model.Choice;

import java.util.List;


/**
 * Created by Administrator on 2017/2/10.
 */

public class SharePinglistviewAdapter extends BaseAdapter {
    private Context context;
    private List<Choice.InfolistBean.ReviewinfolistBean> list;

    public SharePinglistviewAdapter(Context context, List list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder vh;
        if (convertView==null){
            vh=new ViewHolder();
            convertView=View.inflate(context, R.layout.pinglunlistvitem,null);
            vh.tv=(TextView) convertView.findViewById(R.id.pingitem);
            convertView.setTag(vh);
        }else {
            vh=(ViewHolder)convertView.getTag();
        }
        vh.tv.setText("@"+list.get(position).RNickname+":"+list.get(position).RReviewContent);

        return convertView;
    }


    class ViewHolder{
        TextView tv;
    }
}
